package cn.gztang.entity.dto;

import cn.gztang.util.JsoupUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author GaoFeng2017
 * @date 2018/9/8 15:05
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GasTankUpdate {

    @NotNull
    @Range(min = 1)
    private Integer id;

    private Date createdTime;

    private Date inspectionDate;

    private Date scrapTime;

    @Length(min = 1, max = 20)
    private String tankStatus;

    @Length(min = 1, max = 30)
    private String tankType;

    @Length(min = 2, max = 20)
    private String fillUsername;

    @Length(min = 1,max = 30)
    private String fillMedium;

    @Range(min = 1)
    private Integer fillWeight;

    private Date lastFillTime;

    @Length(min = 2, max = 20)
    private String customerName;

    @Length(min = 18)
    private String idCardNumber;

    @Length(min = 1,max = 200)
    private String deliveryAddress;

    @Length(min = 2, max = 20)
    private String deliveryUsername;


    private Date deliveryTime;

    @Range(min = 13)
    private Long tankBarcode;

    @Length(min = 1, max = 30)
    private String productNumber;

    @Length(min = 1, max = 20)
    private String fillUnit;

    public String getTankStatus() {
        return JsoupUtil.getSafeHtml(tankStatus);
    }

    public String getTankType() {
        return JsoupUtil.getSafeHtml(tankType);
    }

    public String getFillUsername() {
        return JsoupUtil.getSafeHtml(fillUsername);
    }


    public String getFillMedium() {
        return JsoupUtil.getSafeHtml(fillMedium);
    }

    public String getCustomerName() {
        return JsoupUtil.getSafeHtml(customerName);
    }

    public String getIdCardNumber() {
        return JsoupUtil.getSafeHtml(idCardNumber);
    }

    public String getDeliveryAddress() {
        return JsoupUtil.getSafeHtml(deliveryAddress);
    }


    public String getDeliveryUsername() {
        return JsoupUtil.getSafeHtml(deliveryUsername);
    }

    public String getProductNumber() {
        return JsoupUtil.getSafeHtml(productNumber);
    }

    public String getFillUnit() {
        return JsoupUtil.getSafeHtml(fillUnit);
    }
}
